﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>定位信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, maximum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="/css/common.css" />
    <link rel="stylesheet" type="text/css" href="/css/index.css" />
    <link href="/css/jquery.dialogbox.css" rel="stylesheet" />

</head>
<body>
    <div class="container">
        <div class="header">
            <div class="headbg"><a href="/page/recommendation.html" class="return"></a></div>
            <p>定位信息</p>
        </div>
        <main>
            <div class="am-container">
                <div id="allmap" style="height: 360px; -webkit-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;">
                </div>
                <input type="hidden" id="LocationBaiduPoint" />
            </div>
            <div class="am-form-group">
                <button onclick="LocationSubmit()" class="am-btn am-btn-block am-btn-primary">确认</button>
            </div>
        </main>
    </div>
</body>
</html>

<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<script src="/static/usi/core.js"></script>
<script src="/static/usi/tools.js"></script>
<script src="/js/MapHelper.js"></script>
<script type="text/javascript" src='//webapi.amap.com/maps?v=1.3&key=da4af82781d6afece1767834af960a6f&&plugin=AMap.Scale,AMap.MouseTool,AMap.ToolBar,AMap.Geocoder'></script>
<script src="//webapi.amap.com/ui/1.0/main.js"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
<script>
    var picValue = "";
    window.onload = function () {
        var scale = new AMap.Scale({
            visible: true
        });
        var toolBar = new AMap.ToolBar({
            visible: true
        });
        map = new AMap.Map("allmap", { center: [MapLngPoint, MapLatPoint], zoom: 15 });
        map.addControl(scale);
        map.addControl(toolBar);
        myGer = new AMap.Geocoder({
            city: "文成县", //城市，默认：“全国”
            radius: 1000 //范围，默认：500
        });
        LocationMapSearch();
    }
    function LocationMapSearch() {
        mouseTool = new AMap.MouseTool(map);
        mouseTool.marker();
        mouseTool.on('draw', function (e) {
            if (e.obj.CLASS_NAME = "AMap.Marker") {
                var position = e.obj.G.position;
                var path = position.lng + "," + position.lat;
                var point = ConvertPoint(path);
                AddMarket(0, point);
                $("#LocationBaiduPoint").val(path);
            }
        });
    }

    function LocationSubmit() {
        if (jQuery.usi.core.isNullOrEmpty($("#LocationBaiduPoint").val())) {
            layer.alert("请先定位");
            return;
        }
        window.location.href = "/page/recommendation.html?BaiduPoint=" + $("#LocationBaiduPoint").val();
    }
</script>
